var app = getApp();
var httpUtils = require('../../utils/httpUtils.js');
Page({
  data: {
    currentTab: 0,
    clientHeight: 'auto',
    invalidOrderList: []
  },
  onLoad: function() {
    var res = wx.getSystemInfoSync();
    var clientHeight = ((res.windowHeight * 2) - 234) + 'rpx';
    this.setData({
      clientHeight: clientHeight
    });
    var _this = this;
    var url = app.globalData.interfaceUrl + '/order.do?method=wxOrdeList';
    console.log(url);
    httpUtils.post(url, {
      'listType': 'sx'
    }, function(res) {
      console.log(res);
      var invalidOrderList = res.data.data;
      _this.setData({
        invalidOrderList: invalidOrderList
      });
    }, function(res) {
      console.log(res);
    });
  },
  stopTouchMove: function () {
    return false;
  },
  clickTab: function(e) {
    var res = wx.getSystemInfoSync();
    var clientHeight = ((res.windowHeight * 2) - 234) + 'rpx';
    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      this.setData({
        currentTab: e.target.dataset.current,
        clientHeight: clientHeight
      })
    }
  }

})